1. Field of the Invention
The present invention generally relates to Computer Aided Software Engineering (CASE) and, more particularly, a method for incorporating scripting into object oriented programming (OOP) applications and small programs called applets.
2. Background Description
OOP is the preferred environment for building user-friendly, intelligent computer software. Key elements of OOP are data encapsulation, inheritance and polymorphism. These elements may be used to generate a graphical user interface (GUI), typically characterized by a windowing environment having icons, mouse cursors and menus. While these three key elements are common to OOP languages, most OOP languages implement the three key elements differently.
Examples of OOP languages are Smalltalk, Object Pascal, C++, and Java. Smalltalk is actually more than a language; it might more accurately be characterized as a programming environment. Smalltalk was developed in the Learning Research Group at Xerox""s Palo Alto Research Center (PARC) in the early 1970s. In Smalltalk, a message is sent to an object to evaluate the object itself Messages perform a task similar to that of function calls in conventional programming languages. The programmer does not need to be concerned with the type of data; rather, the programmer need only be concerned with creating the right order of a message and using the right message. Object Pascal is the language used for Apple""s Macintosh(copyright) computers. Apple developed Object Pascal with the collaboration of Niklaus Wirth, the designer of Pascal. C++ was developed by Bjame Stroustrup at the ATandT Bell Laboratories in 1983 as an extension of C. Java, which was modeled after C++, was originally developed in 1991 as a language for embedded applications such as those used in set-top boxes and other consumer-oriented devices. In 1994, Sun Corp. transitioned Java to the World Wide Web. The key concept of Java and C++ is class, which is a user-defined type. Classes provide object oriented programming features. C++ modules are compatible with C modules and can be linked freely so that existing C libraries may be used with C++ programs. The most widely used object based and object oriented programming languages trace their heritage to Simula developed in the 1960s by O-J. Dahl, B. Myhrhaug and K. Nygard of Norway. Further information on the subject of OOP may be had by reference to Object Oriented Design with Applications by Grady Booch, The Benjamin/Cummings Publishing Co., Inc., Redwood City, Calif. (1991).
Scripting is a method of writing a computer xe2x80x9cprogramxe2x80x9d that is easy and really does not require programming knowledge. A script is a type of program that consists of a set of instructions to an application or utility program. A script usually consists of instructions expressed using the rules and syntax of the application, combined with simple control structures such as loops and if/then expressions. A scripting language is a scripting style programming language implemented in Java or non-Java. Scripting languages such as Netscape Rhino (JavaScript), VBScript, Perl, Tcl, Python, NetRexx and Rexx are commonly used to augment the function of an application or to script together a set of application components to form an application. Rapid development is one reason for using a scripting language.
The Java platform currently does not have a well-defined scripting architecture that allows Java applications to incorporate scripting easily and in a uniform manner. The use of scripting will become even more important as scripting is fast becoming the next wave of software development. There are many advantages of having a standard scripting architecture. First, adopting a scripting architecture instead of an ad hoc approach to script integration and enabling allows applications to quickly and easily support many scripting languages. Script enabling products allows extensions to be written by a wider audience that includes non-programmers. Second, having a single scripting architecture for the platform enables scripting language developers to conform to the architecture once and be universally available to all applications. Finally, common services such as debugging services, which support all scripting languages can be developed.
It is therefore an object of the present invention to provide a method and system for incorporating scripting into Java applications and applets.
It is yet another object of the present invention to provide a method and system that allows the functionality of an application to be modified or enhanced.
The Bean Scripting Framework (BSF) is an architecture for incorporating scripting into Java applications and applets. The BSF provides a set of interfaces that let developers add language-independent scripting to their applications. The invention incorporates scripting into Java applications by using two main components, the BSFManager, and scripting engines.
The BSFManager lets end users write scripts in the scripting languages they like best without burdening the application with language specific knowledge. The BSFManager supports both directions of scripting; that is, when the Java-side is in charge and runs and evaluates scripts at will, as well as cases where the script runs and controls Java beans.
A scripting engine is a scripting language that has been integrated into the BSF. The scripting engines therefore deal with all language-dependent issues. A scripting engine must be written for each scripting language that the BSFManager supports, although to the scripting host, they all look the same. Thus, scripting engines may be provided for JavaScript, NetRexx, Jacl, JPython, VBScript, JScript, LotusXSL, LotusScript and other languages.
The BSF works with any Java object, and not just a true bean. Script enabling Java applications enables those applications to be customized and managed further downstream than previously possible. That is, currently, once a Java application is built and delivered to an end-user or an Independent Software Vendor (ISV), they cannot modify or add to the functionality of the application conveniently. Some applications allow this by having precise extensiblity Application Programming Interfaces (APIs) which ISVs may use. However, ISVs must also use Java in that case to customize the applications. If the application used BSF, then it can expose the appropriate functionality for extensiblity via BSF. ISVs and others may then configure and modify the application using any BSF-supported scripting language. There are two significant advantages with this approach. First, application customization can be done with the customizer""s language of choice (assuming it is supported by BSF). Second, the application does not need to do any additional work to support all the BSF-enabled languages. That is, the application becomes scriptable from all the BSF languages without any application burden.